package com.example.demo6.demos.service;

import com.example.demo6.demos.mapper.FavoritesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FavoriteService {

    @Autowired
    private FavoritesMapper favoritesMapper;

    public void addToFavorites(String userId, String productId) {
        // 执行添加到收藏功能的业务逻辑，比如将用户ID和产品ID关联存储到数据库中
        System.out.println("将用户ID：" + userId + " 和 产品ID：" + productId + " 关联存储到数据库中");
        favoritesMapper.addToFavorites(userId, productId);
    }
}
